﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TSTree.fuctions
{
   public class BranchList : ISortable
    {
        public int entry_number;
        public float mindist;
        public float minmaxdist;
        public bool section;

        private float computeErg(ISortable s, int sortCriterion)
        {
            float erg = (float)0.0;
            switch (sortCriterion)
            {
                case Constants.SORT_MINDIST:
                    erg = this.mindist - ((BranchList)s).mindist;
                    break;
            }
            return erg;
        }

        public bool lessThan(ISortable s, int sortCriterion)
        {
            float erg = computeErg(s, sortCriterion);
            if (erg < (float)0.0) return true;
            return false;
        }

        public bool greaterThan(ISortable s, int sortCriterion)
        {
            float erg = computeErg(s, sortCriterion);
            if (erg > (float)0.0)
                return true;
            return false;
        }
    }
}
